USE [NANS21V]
GO

/****** オブジェクト: Scalar Function [dbo].[Passage] スクリプト日付: 2014/04/17 15:27:31 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

USE [NANS21V]
GO
/****** オブジェクト:  UserDefinedFunction [dbo].[Passage]    スクリプト日付: 04/24/2014 14:45:36 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Passage]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[Passage]


GO
CREATE FUNCTION [dbo].[Passage]
(
	@PLUS int
)
RETURNS VARCHAR(10)
AS
BEGIN
	DECLARE @return varchar(10)
	
	select @return = MSG.TITLE from TBL_WEB_USE_ID ID,TBL_WEB_USE_MSG MSG
	WHERE LOWER(TAGNAME)=LOWER('AdvancingType') 
	AND ID.TAGID=MSG.TAGID
	AND MSG.XMLCODE=@PLUS
		
/*	
	IF @PLUS = 1
		SET @return = 'Q'
	ELSE IF @PLUS = 2
		SET @return = 'q'
	ELSE IF @PLUS = 3
		SET @return = 'R'
	ELSE 
		SET @return = ''
*/
	RETURN @return
END
